package net.url;

import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;

public class GetUrlStream
{
	public static void main(String[] args)
	{
		try
		{
			URL u = new URL("http://www.baidu.com");
			URLConnection con = u.openConnection();
			InputStream in = con.getInputStream();
			int c;
			while((c=in.read())!=-1)
			{
				System.out.write(c);
			}
		}
		catch (Exception e)
		{
		}
	}
}
